package com.geovoice;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/*    This file is part of Geovoice.

Geovoice is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Geovoice is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Geovoice.  If not, see <http://www.gnu.org/licenses/>.  */


public class GoogleVoiceWeb extends Activity {
//	private WebView webView;

	@Override
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
/*		this.getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
		setContentView(R.layout.googlevoiceweb);
		webView = (WebView) findViewById(R.id.webView2);
		webView.getSettings().setJavaScriptEnabled(true);
		webView.loadUrl("https://www.google.com/voice/m/");
	    webView.setWebViewClient(new HelloWebViewClient()); */
	    
	    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com/voice/"));
	    startActivity(browserIntent);
//		webView.setWebChromeClient(new WebChromeClient() {
 //          public void onProgressChanged(WebView view, int progress)   
//           {
             //Make the bar disappear after URL is loaded, and changes string to Loading...
//            setTitle("Loading...");
 //           setProgress(progress * 100); //Make the bar disappear after URL is loaded

             // Return the app name after finish loading
 //               if(progress == 100)
 //              	setTitle(R.string.app_name);
  //            }
 //           });
/*		Button returnToMainButton = (Button)findViewById(R.id.returnToMainButton);
		if(returnToMainButton!=null) {
			returnToMainButton.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View v) {
			finish();
		}
		}); 
		}  */
	    finish();
	}
	
/*	private class HelloWebViewClient extends WebViewClient  
	{

	    @Override
	    public void onPageStarted(WebView view, String url, Bitmap favicon) {
	        // TODO Auto-generated method stub
//	        super.onPageStarted(view, url, favicon);        
//	        view.setVisibility(View.GONE);
//	        pbr.setVisibility(View.VISIBLE);

	    }       

	    @Override
	    public boolean shouldOverrideUrlLoading(WebView  view, String url)
	    {           
	    view.loadUrl(url);  
	    return true;            
	    }

	    @Override
	    public void onPageFinished(WebView view, String url) {
	        // TODO Auto-generated method stub
//	        super.onPageFinished(view, url);            
//	        view.setVisibility(View.VISIBLE);
//	        pbr.setVisibility(View.GONE);
	        view.requestFocus();
	    }



	}  */
}  


	



